#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016-2018, Intel Corporation
#
#
# bttdevice/TEST0 -- test for checking bttcreate tool
#

. ../unittest/unittest.sh

require_test_type medium

require_fs_type any

setup

POOL=$DIR/file.pool
LOG=out${UNITTEST_NUM}.log
rm -f $LOG && touch $LOG

echo "Create btt device - uuid defined by the user" >> $LOG
expect_normal_exit $BTTCREATE -s 20M -b 1K -l 256 \
		-u "9047cad6-53e1-4ba8-bcdd-a9fb411f7392" -v $POOL >> $LOG

expect_normal_exit $PMEMPOOL$EXESUFFIX info $POOL >> $LOG
check_file $POOL
rm -f $POOL

echo -e "\nCreate btt device - automatic uuid generation" >> $LOG
expect_normal_exit $BTTCREATE -s 40M -b 2K -l 256 -v $POOL >> $LOG

expect_normal_exit $PMEMPOOL$EXESUFFIX info $POOL >> $LOG
check_file $POOL

check

pass
